from django.shortcuts import redirect, render
from django.http import HttpResponse
from players.models import Player
from django.core.paginator import EmptyPage,PageNotAnInteger,Paginator

# Create your views here.

def index(request):

    eastplayers =Player.objects.order_by('score').filter(is_published=True, is_east=True)
    westplayers =Player.objects.order_by('score').filter(is_published=True, is_west=True)
    
    context = {
        'eastplayers': eastplayers,
        'westplayers': westplayers,
    }

    return render(request, 'pages/index.html', context)



def about(request):
    return render(request, 'pages/about.html')